<!-- inc:frame.top -->

<!-- if($sysAct == "view") -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=form&act=list">留言管理</a> &raquo; <a href="{:$mainlink}?file=form&act=list">留言列表</a> &raquo; 留言详情</p><!-- inc:position.fr --></div>

<div class="page_pad">
  <form name="qgform" id="qgform" method="post" action="{:$mainlink}?file=form&act=viewok&id={:$id}{if($cateid)}&cateid={:$cateid}{end}" onsubmit="modify_msg()">
  <div class="content_box">
    <div class="content_bor">
      <!-- if($msglist) -->
      <table class="ltable">
        <tr>
          <td width="50">序号</td>
          <td width="200">产品图片</td>
          <td align="left">产品名称</td>
          <td width="240">询盘数量</td>
        </tr>
        <!-- $msglist AS $key=>$value -->
        <tr>
          <td>{:$value[row_index]}</td>
          <td><img class="msglist_img" src="{:$value[folder]}{:$value[thumbfile]}" onclick="tip_img('{:$value[folder]}{:$value[filename]}')" /></td>
          <td align="left">{:$value[subject]}</td>
          <td>{:$value[num]}</td>
        </tr>
        <!-- end -->
      </table>
      <!-- end -->
      <table class="ctable">
        <tr>
          <td class="left">审核：</td>
          <td class="right">
            <input type="radio" name="ifcheck" value="0"{if(!$rs[ifcheck])} checked{end}>
			<span>未审核</span>
            &nbsp;
			<input type="radio" name="ifcheck" value="1"{if($rs[ifcheck])} checked{end}>
			<span>已审核</span>
          </td>
        </tr>
        <tr>
          <td class="left">IP：</td>
          <td class="right">{:$rs[ip]}</td>
		</tr>
        <tr>
          <td class="left">留言人：</td>
          <td class="right">{:$rs[username]}</td>
		</tr>
        <tr>
          <td class="left">电话：</td>
          <td class="right">{:$rs[tel]}</td>
        </tr>
        <tr>
          <td class="left">邮箱：</td>
          <td class="right">{:$rs[email]}</td>
		</tr>
        <tr>
          <td class="left">留言内容：</td>
          <td class="right">{:$rs[content]}</td>
        </tr>
        <!-- if($fieldlist) -->
        <!-- $fieldlist AS $key=>$value -->
        <tr>
          <td class="left">{:$value[field_name]}：</td>
          <td class="right">{:$value[field_content]}</td>
        </tr>
        <!-- end -->
        <!-- end -->
      </table>
    </div>
  </div><!--content_box-->
  
  <div class="gbutton_div"><button type="submit" class="gbutton gbutton_dblue gbutton_add">提交</button> &nbsp; <button type="button" class="gbutton gbutton_add" onclick="qgurl('{:$mainlink}?file=form&act=list{if($cateid)}&cateid={:$cateid}{end}')">返回</button></div>
  </form>
</div><!--page_pad-->

<!-- else -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=form&act=list">留言管理</a> &raquo; 留言列表</p><!-- inc:position.fr --></div>

<form method="post" action="{:$mainlink}?file=form&act=list">
<table class="stable">
  <tr>
    <td class="left">&nbsp;&nbsp;&nbsp;&nbsp;分类：</td>
    <td class="right">
      <table class="ftable">
        <tr>
          <td>
            <select onchange="changese(this)">
              <option >选择分类...</option>
              <option value="0"{if(!$cateid)} selected{end}>全部留言</option>
              <!-- $catelist AS $key=>$value -->
              <option value="{:$value[id]}"{if($cateid == $value[id])} selected{end}>--{:$value[form_name]}</option>
              <!-- end -->
            </select>
            <input type="hidden" name="cateid" id="cateid" value="{:$cateid}" />
          </td>
          <td>关键字：<input class="ginput ginput_minhei" type="text" name="keywords" id="keywords" value="{:$keywords}" /></td>
          <td>
            <select name="stype" id="stype">
              <option value="username"{if($stype == "username")} selected{end}>会员</option>
              <option value="email"{if($stype == "email")} selected{end}>邮箱</option>
            </select>
          </td>
          <td>
            <select name="ifcheck" id="ifcheck">
              <option value="0"{if($ifcheck == "0" || !$ifcheck)} selected{end}>全部</option>
              <option value="1"{if($ifcheck == 1)} selected{end}>已审核</option>
              <option value="2"{if($ifcheck == 2)} selected{end}>未审核</option>
            </select>
          </td>
          <td><button class="gbutton" type="submit">搜索</button></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</form>

<div class="page_pad">
  <div class="content_box">
    <div class="content_bor">
      <table class="ltable">
        <tr class="first">
          <td width="30">&nbsp;</td>
          <td width="100">留言ID</td>
          <td width="50">状态</td>
          <td width="150">表单名称</td>
          <td align="left" width="250">留言人</td>
          <td align="left">邮箱</td>
          <td width="180">发布时间</td>
          <td width="220">操作</td>
        </tr>
        <!-- $formlist AS $key=>$value -->
        <tr>
          <td><div class="check_zw"><input type="checkbox" name="qg_id[]" value="{:$value[id]}"><span></span></div></td>
          <td>{:$value[id]}</td>
          <td><!-- if(!$value[ifcheck]) --><span style="color:red;">[未审核]</span><!-- else --><span style="color:green;">[已审核]</span><!-- end --></td>
          <td><a href="{:$mainlink}?file=form&act=list&cateid={:$value[cateid]}">{:$value[form_name]}</a></td>
          <td align="left">
            <!-- if($value[username]) -->{:$value[username]}<!-- else -->[无]<!-- end -->
          </td>
          <td align="left">{:$value[email]}</td>
          <td>{:$value[postdate]}</td>
          <td>
            <button class="gbutton" type="button" onclick="qg_view({:$value[id]})">查看</button>
            <button class="gbutton" type="button" onclick="qg_delete({:$value[id]})">删除</button>
          </td>
        </tr>
        <!-- end -->
      </table>
    </div>
  </div><!--content_box-->
  
  <div class="content_ctrl">
    <button class="gbutton gbutton_min" type="button" onclick="select_all();upsele();">全选</button>
    <button class="gbutton gbutton_min" type="button" onclick="revCheck();upsele();">反选</button>
    <button class="gbutton gbutton_min" type="button" onclick="selectNone();upsele();">全不选</button>
    <button class="gbutton gbutton_min" type="button" onclick="qg_pl('check')">审核</button>
    <button class="gbutton gbutton_min" type="button" onclick="qg_pl('dcheck')">取消审核</button>
    <button class="gbutton gbutton_min" type="button" onclick="qg_pl('delete')">删除</button>
    
    <div class="content_pagelist">{:$pagelist}</div>
  </div>
</div><!--page_pad-->

<script type="text/javascript">
function changese(o)
{
	if(o.value==0)
	{
		url = "{:$mainlink}?file=form&act=list";
	}
	else
	{
		url = "{:$mainlink}?file=form&act=list&cateid="+o.value;
	}
	self.location.href=url;
}

$(function(){
	$(".ltable tr").click(function () {
		cbox = $(this).find("input[type='checkbox']")
		if(cbox.prop("checked")==true)
		{
			$(this).removeClass("selected");
			cbox.prop("checked",false).attr("checked",false);
		}
		else
		{
			$(this).addClass("selected");
			cbox.prop("checked",true).attr("checked",true);
		}
	});
});

//选择后修改样式
function upsele()
{
	cbox_all = $("input[type='checkbox']");
	$(cbox_all).each(function(){
		if($(this).prop("checked")==true)
		{
			$(this).parents("tr").addClass("selected");
		}
		else
		{
			$(this).parents("tr").removeClass("selected");
		}
	});
}

function qg_view(id)
{
	qgurl("{:$mainlink}?file=form&act=view&id="+id+"{if($cateid)}&cateid={:$cateid}{end}");
}
function qg_delete(id)
{
	//判断是否删除
	url = "{:$mainlink}?file=form&act=delete&id="+id;
	tip_confirm("确认删除该信息吗？特别说明，删除后无法恢复！",url);
}
function qg_pl(qgtype)
{
	var idarray = new Array();//定义一个数组
	var cv = document.getElementsByTagName("input");
	var m = 0;
	for(var i=0; i<cv.length; i++)
	{
		if(cv[i].type.toLowerCase() == "checkbox")
		{
			if(cv[i].checked)
			{
				idarray[m] = cv[i].value;
				m++;
			}
		}
	}
	var id = idarray.join(",");
	if(!id || id == "0")
	{
		tip_alert("没有勾选要操作的主题！");
		return false;
	}
	var url;
	url = "{:$mainlink}?file=form&act=plset&idlist=" + id + "&qgtype=" + qgtype;
	if(qgtype == "delete")
	{
		tip_confirm("确认删除该信息吗？特别说明，删除后无法恢复！",url);
	}
	else
	{
		qgurl(url);
	}
}
</script>
<!-- end -->

<!-- inc:frame.bottom -->